package com.mooc.yohoshop.ui.home;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.mooc.yohoshop.R;
import com.mooc.yohoshop.entity.GoodsEntity;
import com.mooc.yohoshop.imgload.ImageLoad;

import org.jetbrains.annotations.NotNull;

public class HomeGoodsAdapter extends BaseQuickAdapter<GoodsEntity.Values, BaseViewHolder> {
    public HomeGoodsAdapter() {
        super(R.layout.item_home_goods);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, GoodsEntity.Values values) {
        ImageLoad.loadMatch(values.goods_img,(ImageView) baseViewHolder.getView(R.id.home_goods_img));
        baseViewHolder.setText(R.id.home_goods_name,values.goods_name);
        baseViewHolder.setText(R.id.discount_price_tv,values.goods_discount_price);
        baseViewHolder.setText(R.id.original_price_tv,values.goods_original_price);
    }
}
